package moxl.relaxng.validation.testsuite.testsuitetests;

import moxl.dom.MoxlElement;

import org.junit.internal.runners.CompositeRunner;
import org.junit.runner.Description;

public class RelaxNgTestCase implements RelaxNgTestObject
{
	static int counter = 1;

	public RelaxNgTestCase(MoxlElement el)
	{
		MoxlElement firstChild = el.getChildElement(0);
		if (firstChild.getLocalName().equals("incorrect"))
		{
			@SuppressWarnings("unused")
            MoxlElement incorrectSchemaEl = firstChild.getChildElement(0);
			// TODO: A schema which should not be accepted as a RelaxNG schema.
		}
		else if (firstChild.getLocalName().equals("correct"))
		{
			for (MoxlElement docEl : firstChild.getChildElements())
			{
				if (docEl.getLocalName().equals("valid"))
				{
					// TODO: A doc section which should be valid with respect to the schema
				}
				else if (docEl.getLocalName().equals("invalid"))
				{
					// TODO: A doc section which should be invalid with respect to the schema
				}
			}
		}
	}

	public void contributeTests(CompositeRunner runner, Class<?> klass)
	{
		Description description = Description.createTestDescription(klass, "test" + (counter++));
		runner.add(new RelaxNgTestCaseRunner(description, this));
	}

}
